home *** CD-ROM | disk | FTP | other *** search
/ Amiga Tools 3 / Amiga Tools 3.iso / rexx / rotateblur.rexx < prev    next >
OS/2 REXX Batch file  |  1995-06-03  |  2KB  |  110 lines

  1. /*******************************/
  2. /* Image Engineer Macro script */
  3. /* by Simon Edwards            */
  4. /* 3/6/95                      */
  5. /*                             */
  6. /* This creates a sort of spin */
  7. /* motion blur effect.         */
  8. /*******************************/
  9.  
  10. Options results
  11. signal on error            /* Setup a place for errors to go */
  12.  
  13. if arg()==0 then exit
  14.  
  15. PROJECT_INFO arg(1) WIDTH
  16. sourcewidth=RESULT
  17. PROJECT_INFO arg(1) HEIGHT
  18. sourceheight=RESULT
  19.  
  20. 'REQUEST "Number of degrees to blur by" "1|2|4|8|16"'
  21. reply=RESULT
  22.  
  23. if reply=0 then times=4
  24. else times=reply-1
  25.  
  26. 'REQUEST "Step size to use" "1|0.5|0.25|0.125"'
  27. reply=RESULT
  28. select
  29.     when reply=1 then degrees=1
  30.     when reply=2 then do
  31.         degrees=0.5
  32.         times=times+1
  33.         end
  34.     when reply=3 then do
  35.         degrees=0.25
  36.         times=times+2
  37.         end
  38.     when reply=0 then do
  39.         degrees=0.125
  40.         times=times+3
  41.         end
  42. end
  43.  
  44. 'REQUEST "Method to use" "Blur|Max|Min"'
  45. reply=RESULT
  46.  
  47. select
  48.     when reply=1 then method="MIX 50"
  49.     when reply=2 then method="MAX"
  50.     when reply=0 then method="MIN"
  51. end
  52.  
  53. ROTATE arg(1) degrees BEST
  54. temp=RESULT
  55.  
  56. PROJECT_INFO temp WIDTH
  57. tempwidth=RESULT
  58. PROJECT_INFO temp HEIGHT
  59. tempheight=RESULT
  60.  
  61. MARK temp PRIMARY
  62. MARK arg(1) SECONDARY
  63. COMPOSITE (sourcewidth-tempwidth)/2 (sourceheight-tempheight)/2 method
  64. temp2=RESULT
  65. CLOSE temp
  66.  
  67. degrees=degrees*2
  68.  
  69. do while times~=0
  70.  
  71.     ROTATE temp2 degrees BEST
  72.     temp=RESULT
  73.     
  74.     PROJECT_INFO temp WIDTH
  75.     tempwidth=RESULT
  76.     PROJECT_INFO temp HEIGHT
  77.     tempheight=RESULT
  78.     
  79.     MARK temp PRIMARY
  80.     MARK temp2 SECONDARY
  81.     COMPOSITE (sourcewidth-tempwidth)/2 (sourceheight-tempheight)/2 method
  82.     temp3=RESULT
  83.     CLOSE temp2
  84.     CLOSE temp
  85.  
  86.     temp2=temp3
  87.     degrees=degrees*2
  88.     times=times-1
  89. end
  90.  
  91. exit
  92.  
  93. /*******************************************************************/
  94. /* This is where control goes when an error code is returned by IE */
  95. /* It puts up a message saying what happened and on which line     */
  96. /*******************************************************************/
  97. error:
  98. if RC=5 then do            /* Did the user just cancel us? */
  99.     IE_TO_FRONT
  100.     LAST_ERROR
  101.     'REQUEST "'||RESULT||'"'
  102.     exit
  103. end
  104. else do
  105.     IE_TO_FRONT
  106.     LAST_ERROR
  107.     'REQUEST "Error detected!!!'||D2C(10)||'Image Engineer error message is as follows'||D2C(10)||result||D2C(10)||'Script failed on line '||SIGL||'"' 'Doh!'
  108.     exit
  109. end
  110.